Page({
  data: {
      activityList: []
  },

  onLoad() {
      this.getActivityList();
  },

  getActivityList() {
      // 模拟从后端获取数据
      const activityList = [
          {
              id: 1,
              title: "社区运动会",
              time: "2025-07-15",
              location: "社区公园",
              image: "/images/home/cute_1.jpg"
          },
          {
              id: 2,
              title: "亲子阅读活动",
              time: "2025-07-20",
              location: "社区图书馆",
              image: "/images/home/cute_2.jpg"
          }
      ];
      this.setData({
          activityList
      });
  },
  goToDetail(event) {
      const activityId = event.currentTarget.dataset.id;
      console.log(activityId)
      wx.navigateTo({
          url: `/pages/activityDetail/activityDetail?id=${activityId}`
      });
  }
});